/*
Author: michael.p.smith
Object: ajax
Version: 0.1.0
Date: 13/11/06
Dependencies: library
Info:
 - getRequest : fire off the request

 - init : iniate

*/
var ajax = {
	init:function(id) {
		try {
			var oResult = ajax.getRequest(id);
		}
		catch(e) {
			var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
			debug("Unable to get XML data:\n" + msg);
			return;
		}
		return oResult.responseText;
	},
	getRequest:function(id) {
		var url ="" + id + ".html";
		var oHttpRequest = null;
	
		if (window.XMLHttpRequest) { // Mozilla, Safari,...
			oHttpRequest = new XMLHttpRequest();
		} else if (window.ActiveXObject) { // IE
			try {
				oHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
				debug("Unable to get XML data:\n" + msg);
				try {
					oHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
					debug("Unable to get XML data:\n" + msg);
				}
			}
		}
		oHttpRequest.open("GET", url, false);
		oHttpRequest.send(null);
		if (oHttpRequest.readyState == 4) {
			//if (oHttpRequest.status == 200) {
				return oHttpRequest;
			//}
		}
	
	}
};
